<!doctype html>
<html ng-app="angularAgenda">
    <head>
        <meta charset="utf-8">
        <title>Mansa Agenda</title>
       <!-- AngularJS -->
        <script src="../../lib/js/angular.js" type="text/javascript"></script>
        <!-- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.2/angular.min.js"></script> -->
        <!-- jQuery -->
        <script src="../../lib/js/jquery-1.11.0.min.js" type="text/javascript"></script>
       <!--  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> -->
        <!-- Bootstrap CSS -->
        <link rel="stylesheet" href="../../lib/bootstrap-3.1.1/css/bootstrap.min.css">
        <!-- <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> -->
        <!-- Bootstrap JavaScript -->
        <script src="../../lib/bootstrap-3.1.1/js/bootstrap.min.js" type="text/javascript"></script>
        <!-- <script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script> -->
        <!-- JS -->
        <script src="agenda.js"></script>
    </head>
    <body>
        <div ng-controller="ContactController">
        <form class="well">
            <label>Nombre</label>
            <input type="text" name="name" ng-model="newcontact.name">
            <label>Mail</label>
            <input type="text" name="email" ng-model="newcontact.email">
            <label>Telefono</label>
            <input type="text" name="phone" ng-model="newcontact.phone">
            <br/>
            <input type="hidden" ng-model="newcontact.id">
            <input type="button" value="Guardar" ng-click="saveContact()" class="btn btn-primary">
        </form>
        <table class="table table-striped table-bordered">
            <thead>
                <tr>
                    <th>Nombre</th>
                    <th>Mail</th>
                    <th>Telefono</th>
                    <th>Accion</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="contact in contacts">
                    <td>{{ contact.name }}</td>
                    <td>{{ contact.email }}</td>
                    <td>{{ contact.phone }}</td>
                    <td>
                        <a href="#" ng-click="edit(contact.id)">editar</a> |
                        <a href="#" ng-click="delete(contact.id)">borrar</a>
                    </td>
                </tr>
            </tbody>
        </table>
        </div>
    </body>
</html>

